gusucode.com > ASP+ACCESS在线手机销售系统(论文+源代码+答辩PPT) > ASP+ACCESS在线手机销售系统(论文+源代码+答辩PPT)\9)ASP 在线手机销售系统\HandsetPro\handset\admin\manuDel.asp

    <!-- #include file = "include/conndb.asp" -->
<!-- #include file = "include/checkuser.asp" -->
<%
dim strSQL, rsObj, rsProduct
dim intID
intID  =  RealString(Request.QueryString("id"))
'如果参数非法,防止传入类似 manuDel.asp?id=3 or 1=1
if not IsNumeric(intID) then
	Response.Write "<script language = Javascript>"
	Response.Write "alert('您输入的数据不合法!');"
	Response.Write "window.history.go(-1);"
	Response.Write "</script>"
	Response.End 
end if	
strSQL = "SELECT * FROM ProductType WHERE SuperID = "&intID
set rsObj = Server.CreateObject("ADODB.RecordSet")
rsObj.Open strSQL, conn, adOpenKeyset, adLockReadOnly 
if rsObj.eof then
	strSQL = "SELECT * FROM Product WHERE ProductType = "&intID
	set rsProduct = Server.CreateObject("ADODB.RecordSet")
	rsProduct.open strSQL,conn,1,1
	if rsProduct.eof then
		strSQL = "DELETE FROM ProductType WHERE id = "&intID
		'Response.Write strSQL
		conn.Execute ( strSQL )
%>
		<script language = Javascript>
		<!--
		alert("删除成功!");
		this.document.location = "manuList.asp?id=<%=Request.Form("SuperID")%>";
		-->
		</script>
<%
	else
%>
		<script language = Javascript>
			<!--
			alert("该目录下有资料,请先删除资料");
			window.history.go(-1);
			-->
		</script>
<%
	end if
%>
<%
else
%>
	<script language = Javascript>
	<!--
	alert("该目录下有子目录,请先删除子目录");
	window.history.go(-1);
	-->
	</script>
<%
end if
%>